package com.hxkj.controller;

import com.hxkj.task.service.ScheduleTaskService;
import com.platform.common.domain.result.ResultMessageStruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

@RestController
@RequestMapping(value = "/page")
public class ScheduleTaskController {

    @Autowired
    private ScheduleTaskService scheduleTaskService;

    //定时任务生成频道静态页
    @RequestMapping("/genChannelPage")
    public Callable<ResultMessageStruct> genChannelPage(@RequestBody String params) throws Exception{
        return () -> scheduleTaskService.genChannelPage(params);
    }

    //定时任务生成单页静态页
    @RequestMapping("/genLeafletPage")
    public Callable<ResultMessageStruct> genLeafletPage(@RequestBody String params) throws Exception{
        return () -> scheduleTaskService.genLeafletPage(params);
    }

    //定时任务生成文章静态页
    @RequestMapping("/genArticlePage")
    public Callable<ResultMessageStruct> genArticlePage(@RequestBody String params) throws Exception{
        return () -> scheduleTaskService.genArticlePage(params);
    }

    //定时任务生成分类静态页
    @RequestMapping("/genColumnPage")
    public Callable<ResultMessageStruct> genColumnPage(@RequestBody String params) throws Exception{
        return () -> scheduleTaskService.genColumnPage(params);
    }

    //定时任务生成Tags详情静态页
    @RequestMapping("/genTagsPage")
    public Callable<ResultMessageStruct> genTagsPage(@RequestBody String params) throws Exception{
        return () -> scheduleTaskService.genTagsPage(params);
    }

    //定时任务生成整站静态页
    @RequestMapping("/genTotalSitePage")
    public Callable<ResultMessageStruct> genTotalSitePage(@RequestBody String params) throws Exception{
        return () -> scheduleTaskService.genTotalSitePage(params);
    }
}
